// 封装article模块将分类数据存储至vuex中
import { cateListApi } from '@/api/art.js'
export default {
  state () {
    return {
      artList: []
    }
  },
  mutations: {
    setArtList (state, list) {
      state.artList = list
    }
  },
  actions: {
    async AgetArtList ({ commit }) {
      const { data } = await cateListApi()
      // console.log(res)
      // 将数据添加到state中
      commit('setArtList', data.data)
    }
  },
  getters: {},
  namespaced: true
}
